/*
 * Copyright 2008 by Robert Konigsberg
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the same terms as Perl.
 *
 * @see http://www.perl.com/perl/misc/Artistic.html
 */
package visitor.maze;

/**
 * Visits rooms.
 *
 * @author kberg
 */
public interface Visitor {
  /**
   * Determines if this room should be visited. Returns {@code true} if it
   * should and {@code false} if not. When returning {@code true} {@link
   * #visit(Room)} will be called.
   *
   * <p>This method need not be idempotent. In fact, the intent of this
   * method is to prevent a room from being re-visited. Specific behavior,
   * however, is left up to the implementation.
   */
  boolean shouldVisit(Room room);

  /**
   * Visit a room.
   */
  void visit(Room room);
}
